﻿using UnityEngine;
using System.Collections;

public class AlwaysFaceCamera : MonoBehaviour {
	
//	    var cameraToLookAt: Camera;
//     
//    function Update()
//    {
//          var v: Vector3 = cameraToLookAt.transform.position - transform.position;
//          v.x = v.z = 0.0;
//          transform.LookAt(cameraToLookAt.transform.position - v);
//    }
	
	Camera cameraToLookAt;
	
	// Use this for initialization
	void Start () {
		cameraToLookAt = Camera.main;
	}
	
	// Update is called once per frame
	void Update () {
		Vector3 v = cameraToLookAt.transform.position - transform.position;
		v.x = v.z = 0;
		transform.LookAt(cameraToLookAt.transform.position - v);
	}
}
